import Vue from 'vue'
import App from './App.vue'
import Login from './Login.vue'

import VueRouter from 'vue-router'
Vue.use(VueRouter)

import Element from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
Vue.use(Element)
import qfValidator from '@/components/common/yzValidator.js'
Vue.prototype.qfValidator = qfValidator
import axios from 'axios'
var querystring = require('querystring')
Vue.prototype.querystring = querystring
Vue.prototype.$ajax = axios
// axios({
// 		url:'http://local.api.ditan/adminApi/cellList',
// 		//url:'http://localhost/4.php',
// 		method:'post',
// 		responseType:'json',
// 		data:{},
// 	}).then((res)=>{
// 		console.log(res)
// 	}).catch((err)=>{
// 		console.log(err)
// 	})
import routesList from './config/routes'
if (sessionStorage.getItem('login') !== 'true') {
	new Vue({
	  el: '#app',
	  render: h => h(Login)
	})
}else{
	var routes = routesList.configs()
	var jsons = sessionStorage.getItem('actionList')
	var list = JSON.parse(jsons)
	routes.push({list:list,path:'md5'});
	// 使用配置文件规则
	const router = new VueRouter({
	  routes
	})

	//router.start(App, '#app');
	new Vue({
	  el: '#app',
	  router,
	  render: h => h(App)
	}).$mount('#app')
}
